{% extends 'question-manage/question-form-layout.html.twig' %}

{% block question_extra_fields %}
  <div data-role="choices"></div>
  
  <div class="question-options" id="question-options"  data-image-upload-url="{{ path('editor_upload', {token:upload_token('course')}) }}" data-image-download-url="{{ path('editor_download', {token:upload_token('course')}) }}" 
    data-choices="{% if question.metas.choices|default(null) %}
      {{question.metas.choices|json_encode}}
    {% endif %}"  data-answer= "
    {% if question.answer|default(null) %}
      {{question.answer|json_encode}}
    {% endif %}">
  </div>
  <div id="choices-group"></div>
  {% if question.metas.choices|default(null) %}
    <script type="text/plain" data-role="choices-data">
      {{ question.metas.choices|json_encode|raw}}
    </script>
    <script type="text/plain" data-role="answers-data">
      {{ question.answer|json_encode|raw}}
    </script>
  {% endif %}
{% endblock %}
